home *** CD-ROM | disk | FTP | other *** search
- /* 1995 H.Ogasawara (COR.) */
-
- #include <sys_doslib.h>
- #include <wlib.h>
-
- extern int WindowProcessID;
- extern int WindowHeapSize;
- extern void _HeapInit();
-
- #ifdef XC
- extern char *_BEND,
- *_HSTA,
- *_HEND;
- #endif
- #ifdef LIBC
- extern char *_esta,
- *_HSTA,
- *_HEND;
- # define _BEND _esta
- #endif
-
-
- int
- KoWindowHeapAlloc()
- {
- ProcessInfo *pp= WindowGetProcessInfo( WindowProcessID );
- char *heap;
- if( pp->HeapSize > 0 ){
- MFREE( pp->Heap );
- pp->HeapSize= 0;
- }
- if( WindowHeapSize > 0 ){
- heap= MALLOC( WindowHeapSize );
- if( heap > (char*)0x1000000 )
- return FALSE;
- _HSTA= heap;
- _HEND= _HSTA+ WindowHeapSize;
- #ifdef XC
- _HeapInit();
- #endif
- pp->Heap= heap;
- }else
- _HEND= _HSTA;
- pp->HeapSize= WindowHeapSize;
- return TRUE;
- }
-
-